<?php

		$idu = $this->uri->segment(2, 0);
		
		$js_url = base_url('js');
		$css_url = base_url('css');
		$images_url = base_url('images');
		$main_url = base_url('main');
		$usaha_url = base_url('usaha');
		$upload_url = base_url('uploads');

		$linklapor = urlencode(current_url());
		$laporkan = "Konten tak layak? <a href='$main_url/lapor?link=$linklapor'>Laporkan</a>";
		$notfound = "<tr><td class='left'>&nbsp;</td><td class='right'>Data Tidak Ditemukan</td></tr>";

		$mapdir = "
			<a href='$main_url'>Home</a>
			&gt; 
			<a href='$main_url/usaha.html'>Usaha</a> &gt; 
		";

		$other_head = "
		<script type='text/javascript' src='$js_url/jquery.fancybox.js'></script>
		<link rel='stylesheet' type='text/css' href='$css_url/jquery.fancybox.css' media='screen' />
		<script type='text/javascript'>
			
			\$jq(function() {
				
				\$jq('a#lihat').fancybox({
						'overlayShow'	: true,
						'transitionIn'	: 'elastic',
						'transitionOut'	: 'elastic'
				});
				
				var lihatloker = \$jq('#lihatloker').attr('href');
				var lihatproduk = \$jq('#lihatproduk').attr('href');
				
				\$jq('#ambilloker').load(lihatloker+' #loker');
				\$jq('#ambilproduk').load(lihatproduk+' #produk');
				
				
				
			});
			</script>
		";
		

		$detail = "";
		$hit = 1;
		
		$usaha = $this->mainmodel->get_data_perusahaan($idu);
		if($usaha !== FALSE)
		{
			foreach($usaha AS $udata)
			{
				$idc = $udata->idperusahaan;
				$lowongan = "-";
				
				$nama = html_escape($udata->nama);
				$pemilik = html_escape($udata->pemilik);
				$deskripsi = xss_clean($udata->deskripsi);
				$alamat = xss_clean($udata->alamat);
				$kota = html_escape($udata->kota);
				$email = auto_link(html_escape($udata->email), 'email');
				$situs = anchor(html_escape($udata->situs), html_escape($udata->situs), 'target="_blank"');
				$mapdir .= "<b>".$nama."</b>";
				$title = url_title($nama, '-', TRUE);
				
				
				$kategori = html_escape($this->mainmodel->get_single_data('kategori','dn_category','idkategori',$udata->idkategori));
				
				if( ! empty($udata->logo))
				{
					$detail .= "
					<tr>
						<td class='left'><a id='lihat' href='$upload_url/perusahaan/$udata->logo'><img alt='logo usaha' src='$upload_url/perusahaan/$udata->logo' style='width:80%;border:0px' /></a></td>
						<td class='right'>&nbsp;</td>
					</tr>
					";
				}
				
				$detail .= "
					<tr>
						<td class='left'>Nama Perusahaan</td>
						<td class='right'> $nama</td>
					</tr>
					<tr>
						<td class='left'>Kategori Usaha</td>
						<td class='right'> <a target='_blank' title='Tampilkan perusahaan dalam kategori $kategori' href='$main_url/kategori.html?lihat=detail&amp;idk=$udata->idkategori'>$kategori</a></td>
					</tr>
					<tr>
						<td class='left'>Pemilik</td>
						<td class='right'> $pemilik</td>
					</tr>
					<tr>
						<td class='left'>Alamat</td>
						<td class='right'>$alamat</td>
					</tr>
					<tr>
						<td class='left'>Kota</td>
						<td class='right'>$kota <a target='_blank' href='https://maps.google.com/maps?q=$kota'>[lihat peta]</a> </td>
					</tr>
					<tr>
						<td class='left'>E-mail</td>
						<td class='right'>$email</td>
					</tr>
					<tr>
						<td class='left'>Situs</td>
						<td class='right'>$situs</td>
					</tr>
					<tr>
						<td class='left'>Telp.</td>
						<td class='right'> $udata->telp</td>
					</tr>
					<tr>
						<td class='left'>Produk</td>
						<td class='right'>
							<div id='ambilproduk'><a href='$usaha_url/$idc/$title/produk.html' id='lihatproduk'>[Lihat]</a></div>
						</td>
					</tr>
					<tr>
						<td class='left'>Info Lowongan</td>
						<td class='right'>
							<div id='ambilloker'><a href='$usaha_url/$idc/$title/loker.html' id='lihatloker'>[Lihat]</a></div>
						</td>
					</tr>
					<tr>
						<td class='left'>&nbsp;</td>
						<td class='right'>&nbsp;</td>
					</tr>
				";
			}
			
		}else{
			$detail .= "<tr><td class='left'>&nbsp;</td><td class='right'>Data Tidak Ditemukan</td></tr>";
		}

		

		$uri2 = $this->uri->segment(2, 0);
		$uri3 = $this->uri->segment(3, 'ya');
		$uri4 = $this->uri->segment(4, 'apa');

		$isipage = "
			<div id='content2'>
					<h3>Detail Usaha</h3>
						
						<div class='isicontent2'>
							
							<div id='kertas' style='background-image:url($images_url/kertas.gif); background-size:100% 100%;background-position:right;' >
								
							</div>
							
							<table style='background-image:url($images_url/kertas2.gif); background-size:100% 100%;background-position:right;'>
								<tbody>
									
									$detail
									
									
									<tr>
										<td class='left'>
											<!--<a href='$main_url/pdf/$uri2/$uri4/$uri3'>Simpan PDF</a>-->$laporkan
										</td>
										<td class='right'>&nbsp;</td>
									</tr>
									<tr>
										<td class='left'> &nbsp; </td>
										<td class='right'> &nbsp; </td>
									</tr>
									
									<tr>
										<td class='left'>&nbsp;</td>
										<td class='right'>
											<a href='javascript:history.go(-1)'>&lt;&lt; Kembali</a> 
										</td>
									</tr>
									
								</tbody>
							</table>
						  
						  
						</div>
					</div>
		";

		$data['map_dir'] = $mapdir;
		$data['isi_page'] = $isipage;
		$data['other_head'] = $other_head;$data['other_head'] = $other_head;
		$data['site_title'] = 'Detail Data - Dadan Network';
		$data['site_description'] = 'Dadan Network adalah situs berbagi informasi tentang jaringan profesional antar enterpreneur indonesia';
		$data['site_keywords'] = 'dadan, network, profesional, enterpreneur, produk, usaha';
		$data['base_url'] = base_url();
		$data['tahun_sekarang'] = date("Y");

		$this->parser->parse('template/home', $data);

/* End of file detail.php */
/* Location: ./application/views/company/detail.php */
